<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>

<!--[if IEMobile 7]><html class="no-js iem7 oldie"><![endif]-->
<!--[if (IE 7)&!(IEMobile)]><html class="no-js ie7 oldie" lang="en"><![endif]-->
<!--[if (IE 8)&!(IEMobile)]><html class="no-js ie8 oldie" lang="en"><![endif]-->
<!--[if (IE 9)&!(IEMobile)]><html class="no-js ie9" lang="en"><![endif]-->
<!--[if (gt IE 9)|(gt IEMobile 7)]><!--><html class="no-js" lang="en"><!--<![endif]-->

<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

	<title>文化创意产业项目虚拟仿真实验教学系统</title>
	<%@include file="/header.jsp" %>
	<script type="text/javascript" src="/js/init.js"></script>
	<script type="text/javascript">
		$(function() {
			activeMenu(1);
		})
		
		function newsDialog(id) {
			var url = id==null?'/temp/news':'/main/content/'+id;
			var modal = $.modal({
				title: "系统消息",
				url: url,
				width: 900,
				ajax: {
					success: function()
					{
						modal.centerModal();
					}
				},
				buttons: {
					'关闭': {
						classes: 'small blue-gradient glossy center',
						click: function(win) { win.closeModal(); }
					}
				}
			});
		}
		
		function taskDialog(taskId, orderId, node) {
			var modal = $.modal({
				title: "任务编辑",
				width: 500,
				url: "/task/currentTask/"+taskId+"-"+orderId,
				ajax: {
					success: function()
					{
						modal.centerModal();
					}
				},
				buttons: {
					'提交': {
						classes: 'small blue-gradient glossy center',
						click: function(win) {
							$.ajax({
								url:"/task/execute",
								type:"post",
								data:$("#task-form").serialize()
									+"&orderId="+orderId+"&taskId="+taskId+"&node="+node,
								dataType:"json"
							}).done(function(data){
								myalert(data.msg, function() {
									if(data.isSuccess) {
										win.closeModal();
										window.location = window.location;
									}
								})
							})
						}
					},
					'关闭': {
						classes: 'small blue-gradient glossy center',
						click: function(win) { win.closeModal(); }
					}
				}
			});
		}
		
		function viewAsk(id) {
			var modal = $.modal({
				title: "查看问题",
				url: '/ask/add/'+id+'?oper=view',
				width: 800,
				ajax: {
					success: function()
					{
						modal.centerModal();
					}
				},
				buttons: {
					'关闭': {
						classes: 'small blue-gradient glossy center',
						click: function(win) { 
							win.closeModal(); 
							window.location = window.location;
						}
					}
				}
			})
		}
		
		function viewProject(id) {
			var modal = $.modal({
				title: "查看项目",
				url: '/project/detail/'+id,
				width: 900,
				ajax: {
					success: function()
					{
						modal.centerModal();
					}
				},
				buttons: {
					'关闭': {
						classes: 'small blue-gradient glossy center',
						click: function(win) { win.closeModal(); }
					}
				}
			})
		}
		
		function viewFlow(name, displayName) {
			var modal = $.modal({
				title: displayName,
				width: 900,
				content:"<img src='img/snaker/"+name+".png'>",
				ajax: {
					success: function()
					{
						modal.centerModal();
					}
				},
				buttons: {
					'关闭': {
						classes: 'small blue-gradient glossy center',
						click: function(win) { win.closeModal(); }
					}
				}
			});
		}
		
		function viewCourse(id) {
			var modal = $.modal({
				title: "查看课程",
				url: "/course/view/"+id,
				width:750,
				ajax: {
					success: function()
					{
						modal.centerModal();
					}
				},
				buttons: {
					'关闭': {
						classes: 'small blue-gradient glossy center',
						click: function(win) {
							win.closeModal();
						}
					}
				}
			});
		}
		
		function viewUncertain(id) {
			var modal = $.modal({
				title: "查看项目",
				url: '/uncertain/load/'+id,
				width: 900,
				ajax: {
					success: function()
					{
						modal.centerModal();
					}
				},
				buttons: {
					'关闭': {
						classes: 'small blue-gradient glossy center',
						click: function(win) { win.closeModal(); }
					}
				}
			});
		}
		
	</script>
	<style type="text/css">
		#demo-chart p{text-align: left;}
	</style>
</head>

<body class="clearfix with-menu with-shortcuts">

	<!-- Prompt IE 6 users to install Chrome Frame -->
	<!--[if lt IE 7]><p class="message red-gradient simpler">Your browser is <em>ancient!</em> <a href="http://browsehappy.com/">Upgrade to a different browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to experience this site.</p><![endif]-->

	<!-- Title bar -->
	<header role="banner" id="title-bar">
		<h2>文化创意产业项目虚拟仿真实验教学系统</h2>
	</header>

	<!-- Button to open/hide menu -->
	<a href="#" id="open-menu"><span>Menu</span></a>

	<!-- Button to open/hide shortcuts -->
	<a href="#" id="open-shortcuts"><span class="icon-thumbs"></span></a>

	<!-- Main content -->
	<section role="main" id="main">

		<noscript class="message black-gradient simpler">Your browser does not support JavaScript! Some features won't work as expected...</noscript>

		<hgroup id="main-title" class="thin">
			<h1>工作台</h1>
			<!-- <h2>nov <strong>10</strong></h2> -->
		</hgroup>
		
		<div class="dashboard">
			<div class="columns">
				<div class="nine-columns twelve-columns-mobile" id="demo-chart">
					<ul class="list spaced">
						<li>
							<a href="javascript:;" class="list-link icon-user" onclick='newsDialog();'>
								<span class="meter red-gradient"></span>
								<span class="meter"></span>
								<span class="meter green-gradient"></span>
								<span class="meter green-gradient"></span>
								&emsp;平台简介
							</a>
						</li>
						<c:forEach items="${msgs }" var="msg">
						<li>
							<a href="javascript:;" class="list-link icon-user" onclick='newsDialog("${msg.id}");'>
								<span class="meter red-gradient"></span>
								<span class="meter"></span>
								<span class="meter green-gradient"></span>
								<span class="meter green-gradient"></span>
								&emsp;${msg.title }
							</a>
						</li>
						</c:forEach>
					</ul>
				</div>
		
				<div class="three-columns twelve-columns-mobile new-row-mobile">
					<ul class="stats split-on-mobile">
						<li><a href="javascript:;">
							<strong>${projectPage.totalRow }</strong> 项目列表<br>
						</a></li>
						<li><a href="javascript:;">
							<strong>15</strong> 任务列表<br>
						</a></li>
						<li><a href="javascript:;">
							<strong>${askPage.totalRow }</strong> 问题列表<br>
						</a></li>
						<li><a href="javascript:;">
							<strong>${msgPage.totalRow }</strong> 消息列表<br>
						</a></li>
					</ul>
				</div>
			</div>
		</div>
		
		<div class="with-padding">
			<jsp:include page="type/${userType }.jsp"/>
		</div>
	</section>
	<!-- End main content -->
</body>
</html>